Write a custom CUDA kernel to optimize `MElliott` (Modification of Elliott AF).

Formula: f(x) = x / sqrt(1 + x^2)

This function is also known as ISRU with alpha=1.

Problem Analysis:
1. Memory Bound: This is a point-wise activation with moderate arithmetic intensity (sqrt, div).
2. Operator Chaining: A PyTorch implementation creates intermediate tensors for pow, sqrt, etc.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Thread-per-Element: Map each element to a CUDA thread.

2. Vectorized Loads (float4): Use `float4` to process 128 bits per memory transaction.

3. Fused Fast Math:
   - For each element `x`:
     `inv_sqrt = rsqrtf(1.0f + x * x)` (fast inverse square root)
     `result = x * inv_sqrt`
   - All computations are fused in registers.

4. One-Pass: Fuse all steps into a single read-compute-write kernel.

import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

class MElliott(nn.Module):
    '''
    Formula: f(x) = x / sqrt(1 + x^2)
    '''
    def __init__(self):
        super(MElliott, self).__init__()

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        # PyTorch 原生实现
        return x / torch.sqrt(1.0 + x.pow(2))

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.act = MElliott()
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return []